package com.wt.struggle.goodbye.info

import android.os.Parcel
import android.os.Parcelable

class NewsInfo() : Parcelable {

    var initRes: Int = 0
    var id: Int? = 0
    var topicId: Int = 0
    var circleId: Int = 0
    var name: String? = ""
    var icon: String? = ""
    var content: String? = ""
    var keywords: String? = ""
    var commentCount: Int? = 0
    var topicColor: String? = ""
    var pics: String? = ""
    var audios: String? = ""
    var videos: String? = ""
    var pic: String? = ""
    var iconUrl: String? = ""
    var des: String? = ""
    var recommend: String? = ""
    var domainname: String = ""
    var path: String? = ""
    var createTime: Long? = 0
    var picUrl: String? = ""

    var isCollection: Int? = 0
    var isLike: Int? = 0
    var circleName: String? = ""
    var topicName: String? = ""
    var distance: String = ""

    var subCommentInfoList: ArrayList<MessageInfo>? = null

    var isZan: Boolean = false
    var isDownZan: Boolean = false
    var isCollect: Boolean = false
    var isAttention: Int = 0

    var platform: String? = ""
    var viewsCount: String? = ""
    var title: String = ""
    var collectionCount: Int = 0
    var likeCount: Int = 0
    var userExtraInfo: ProUserInfo? = null
    var appUserExtraInfo: ProUserInfo? = null
    var location: String? = ""
    var isCheck = false
    var rules: String? = ""
    var requirements: String? = ""
    var giftPic1: Int = 0
    var giftPic2: Int = 0
    var lat: String = ""
    var lng: String = ""

    var createtime: Long = 0

    var coverPic: Int = 0
    var endtimeStr: String? = ""
    var starttimeStr: String? = ""
    var numberOfCommented: Int? = 0
    var numberOfLiked: Int? = 0
    var numberOfCollected: Int? = 0
    var numberOfCircleCollected: Int? = 0

    var status: Int? = 0
    var width: Int? = 0
    var height: Int? = 0
    var openType = 0
    var toId = 0
    var linkUrl = ""

    var videoList: ArrayList<VideoInfo>? = null

    var audioList: ArrayList<VideoInfo>? = null

    var picList: ArrayList<VideoInfo>? = null

    var picsUrlList: ArrayList<String>? = null

    constructor(parcel: Parcel) : this() {
        initRes = parcel.readInt()
        id = parcel.readValue(Int::class.java.classLoader) as? Int
        topicId = parcel.readInt()
        circleId = parcel.readInt()
        name = parcel.readString()
        icon = parcel.readString()
        content = parcel.readString()
        keywords = parcel.readString()
        commentCount = parcel.readValue(Int::class.java.classLoader) as? Int
        topicColor = parcel.readString()
        pics = parcel.readString()
        audios = parcel.readString()
        videos = parcel.readString()
        pic = parcel.readString()
        iconUrl = parcel.readString()
        des = parcel.readString()
        recommend = parcel.readString()
        domainname = parcel.readString()
        path = parcel.readString()
        createTime = parcel.readValue(Long::class.java.classLoader) as? Long
        picUrl = parcel.readString()
        isCollection = parcel.readValue(Int::class.java.classLoader) as? Int
        isLike = parcel.readValue(Int::class.java.classLoader) as? Int
        circleName = parcel.readString()
        topicName = parcel.readString()
        distance = parcel.readString()
        isZan = parcel.readByte() != 0.toByte()
        isDownZan = parcel.readByte() != 0.toByte()
        isCollect = parcel.readByte() != 0.toByte()
        isAttention = parcel.readInt()
        platform = parcel.readString()
        viewsCount = parcel.readString()
        title = parcel.readString()
        collectionCount = parcel.readInt()
        likeCount = parcel.readInt()
        userExtraInfo = parcel.readParcelable(ProUserInfo::class.java.classLoader)
        appUserExtraInfo = parcel.readParcelable(ProUserInfo::class.java.classLoader)
        location = parcel.readString()
        isCheck = parcel.readByte() != 0.toByte()
        rules = parcel.readString()
        requirements = parcel.readString()
        giftPic1 = parcel.readInt()
        giftPic2 = parcel.readInt()
        lat = parcel.readString()
        lng = parcel.readString()
        createtime = parcel.readLong()
        coverPic = parcel.readInt()
        endtimeStr = parcel.readString()
        starttimeStr = parcel.readString()
        numberOfCommented = parcel.readValue(Int::class.java.classLoader) as? Int
        numberOfLiked = parcel.readValue(Int::class.java.classLoader) as? Int
        numberOfCollected = parcel.readValue(Int::class.java.classLoader) as? Int
        numberOfCircleCollected = parcel.readValue(Int::class.java.classLoader) as? Int
        status = parcel.readValue(Int::class.java.classLoader) as? Int
        width = parcel.readValue(Int::class.java.classLoader) as? Int
        height = parcel.readValue(Int::class.java.classLoader) as? Int
        openType = parcel.readInt()
        toId = parcel.readInt()
        linkUrl = parcel.readString()
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeInt(initRes)
        parcel.writeValue(id)
        parcel.writeInt(topicId)
        parcel.writeInt(circleId)
        parcel.writeString(name)
        parcel.writeString(icon)
        parcel.writeString(content)
        parcel.writeString(keywords)
        parcel.writeValue(commentCount)
        parcel.writeString(topicColor)
        parcel.writeString(pics)
        parcel.writeString(audios)
        parcel.writeString(videos)
        parcel.writeString(pic)
        parcel.writeString(iconUrl)
        parcel.writeString(des)
        parcel.writeString(recommend)
        parcel.writeString(domainname)
        parcel.writeString(path)
        parcel.writeValue(createTime)
        parcel.writeString(picUrl)
        parcel.writeValue(isCollection)
        parcel.writeValue(isLike)
        parcel.writeString(circleName)
        parcel.writeString(topicName)
        parcel.writeString(distance)
        parcel.writeByte(if (isZan) 1 else 0)
        parcel.writeByte(if (isDownZan) 1 else 0)
        parcel.writeByte(if (isCollect) 1 else 0)
        parcel.writeInt(isAttention)
        parcel.writeString(platform)
        parcel.writeString(viewsCount)
        parcel.writeString(title)
        parcel.writeInt(collectionCount)
        parcel.writeInt(likeCount)
        parcel.writeParcelable(userExtraInfo, flags)
        parcel.writeParcelable(appUserExtraInfo, flags)
        parcel.writeString(location)
        parcel.writeByte(if (isCheck) 1 else 0)
        parcel.writeString(rules)
        parcel.writeString(requirements)
        parcel.writeInt(giftPic1)
        parcel.writeInt(giftPic2)
        parcel.writeString(lat)
        parcel.writeString(lng)
        parcel.writeLong(createtime)
        parcel.writeInt(coverPic)
        parcel.writeString(endtimeStr)
        parcel.writeString(starttimeStr)
        parcel.writeValue(numberOfCommented)
        parcel.writeValue(numberOfLiked)
        parcel.writeValue(numberOfCollected)
        parcel.writeValue(numberOfCircleCollected)
        parcel.writeValue(status)
        parcel.writeValue(width)
        parcel.writeValue(height)
        parcel.writeInt(openType)
        parcel.writeInt(toId)
        parcel.writeString(linkUrl)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<NewsInfo> {
        override fun createFromParcel(parcel: Parcel): NewsInfo {
            return NewsInfo(parcel)
        }

        override fun newArray(size: Int): Array<NewsInfo?> {
            return arrayOfNulls(size)
        }
    }


}